﻿<%@ Page Title="Ultimate Vacation Experience CMS :: Bookings :: Tour" Language="C#" MasterPageFile="~/Admin/Admin.Master" AutoEventWireup="true" CodeBehind="Tour.aspx.cs" Inherits="TravelSite.Admin.Bookings.TourPage" %>
<asp:Content ID="Content1" ContentPlaceHolderID="HeadContent" runat="server">
    <script type="text/javascript">
        $(function () {
            $.datepicker.setDefaults($.datepicker.regional[""]);

            $("#<%= txtFromDateFilter.ClientID %>").datepicker($.datepicker.regional["en-GB"]);
            $("#<%= txtFromDateFilter.ClientID %>").datepicker({
                showmonth: true,
                autoSize: true,
                showAnim: 'slideDown',
                duration: 'fast'
            });
            $("#<%= btnShowFromDateFilter.ClientID %>").click(function () {
                $("#<%= txtFromDateFilter.ClientID %>").datepicker('show');
            });

            $("#<%= txtToDateFilter.ClientID %>").datepicker($.datepicker.regional["en-GB"]);
            $("#<%= txtToDateFilter.ClientID %>").datepicker({
                showmonth: true,
                autoSize: true,
                showAnim: 'slideDown',
                duration: 'fast'
            });
            $("#<%= btnShowToDateFilter.ClientID %>").click(function () {
                $("#<%= txtToDateFilter.ClientID %>").datepicker('show');
            });

            Sys.WebForms.PageRequestManager.getInstance().add_pageLoaded(function (evt, args) {
                $(".search_input").on('keyup', function () {
                    __doPostBack('<%= upMain.ClientID %>', '');
                });
            });
        });

        function SetGridDateEdit(textId, buttonId) {
            $("#" + textId).datepicker($.datepicker.regional["en-GB"]);
            $("#" + textId).datepicker({
                showmonth: true,
                autoSize: true,
                showAnim: 'slideDown',
                duration: 'fast'
            });
            $("#" + buttonId).click(function () {
                $("#" + textId).datepicker('show');
            });
        }
    </script>
    <style type="text/css">
        .action_link
        {
            margin-right: 5px;
        }
        
        .sort_button
        {
            color: #ffffff;
            margin-right: 5px;
        }
    </style>

</asp:Content>
<asp:Content ID="Content2" ContentPlaceHolderID="MainContent" runat="server">
    
            <div class="page_header">
                <h2><img src="<%=ResolveClientUrl("~") %>images/design/dashboard_icon.png" alt="" title="" /> Tour</h2>
            </div>
            
            <div class="search_panel">
                <div class="row">                	
                    <div class="col-lg-2">
                    	<div class="form-group">
                            <label class="control-label" for="txtFromDateFilter">Date From</label>
                            <div class="input-group">
                                <asp:TextBox runat="server" ID="txtFromDateFilter" CssClass="form-control" placeholder="Date From"/>
                                <span class="input-group-btn">
                                    <button runat="server" class="btn btn-default" type="button" id="btnShowFromDateFilter">
                                        <img src="<%=ResolveClientUrl("~") %>images/calander_icon.png" alt="calander" title="Calander" />
                                    </button>
                                </span>
                            </div> 
                        </div>
                    </div>
                    <div class="col-lg-2">
                    	<div class="form-group">
                            <label class="control-label" for="txtToDateFilter">Date To</label>
                            <div class="input-group">
                                <asp:TextBox runat="server" ID="txtToDateFilter" CssClass="form-control" placeholder="Date To"/>
                                <span class="input-group-btn">
                                    <button runat="server" class="btn btn-default" type="button" id="btnShowToDateFilter">
                                        <img src="<%=ResolveClientUrl("~") %>images/calander_icon.png" alt="calander" title="Calander" />
                                    </button>
                                </span>
                            </div> 
                        </div>
                    </div>

                    <div class="col-lg-2">                    	
                    	<asp:Button CssClass="btn btn-primary search_btn" ID="btnSearch" Text="Filter" runat="server" onclick="btnSearch_Click" />
                    </div>
                    <div class="col-lg-1" style="float:right">
                        <label class="control-label" for="ddlPageSizeFilter">Page Size</label>
                        <asp:DropDownList CssClass="form-control" ID="ddlPageSizeFilter" runat="server" AutoPostBack="true" OnSelectedIndexChanged="ddlPageSizeFilter_SelectedIndexChanged"/>
                    </div>
                    
                </div>
            </div>

            <asp:UpdatePanel ID="upMain" runat="server" UpdateMode="Conditional">
            <ContentTemplate>
           
        	<div class="page_container">
                <asp:ImageButton ID="btnExcelExport" runat="server" ImageUrl="~/images/excel-icon.png" ToolTip="Export To Excel" OnClick="btnExcelExport_Click" Height="24" Width="24" />

                <div class="table-responsive" style="overflow-x:auto;width:100%;">

                <asp:GridView ID="grid" AutoGenerateColumns="false" runat="server" CssClass="table table-bordered table-hover"
                AllowPaging="True" PageSize="20" DataKeyNames="ContactId"
                AllowSorting="true" OnSorting="grid_Sorting" OnRowCreated="grid_RowCreated" 
                OnPageIndexChanging="grid_PageIndexChanging" onrowdatabound="grid_RowDataBound"
                OnRowCancelingEdit="grid_RowCancelingEdit" OnRowEditing="grid_RowEditing" OnRowUpdating="grid_RowUpdating" OnRowCommand="grid_RowCommand">
                <PagerSettings Mode="Numeric" PageButtonCount="4" NextPageText=">" PreviousPageText="<"  FirstPageText="<<" LastPageText=">>"/>
                <Columns>
                    <asp:TemplateField HeaderText="Action"> 
                        <ItemTemplate> 
                            <asp:ImageButton runat="server" ImageUrl="~/images/design/actions_icon/edit_icon.png" ToolTip="Edit" CssClass="action_link" CausesValidation="False" CommandName="Edit" />
                        </ItemTemplate> 
                        <EditItemTemplate> 
                            <asp:ImageButton runat="server" ImageUrl="~/images/design/actions_icon/check_icon.png" ToolTip="Update" CssClass="action_link" CausesValidation="True" CommandName="Update" />
                            <asp:ImageButton runat="server" ImageUrl="~/images/design/actions_icon/cancel_icon.png" ToolTip="Cancel" CssClass="action_link" CausesValidation="False" CommandName="Cancel" />
                        </EditItemTemplate> 
                    </asp:TemplateField> 

                    <asp:TemplateField HeaderText="Client"> 
                        <HeaderTemplate>
						    <asp:Label runat="server" ID="lblFullNameHeader" data-field="FullName" Text="Client"/>
                            <asp:TextBox ID="tbFullNameHeader" EnableViewState="True" data-field="FullName" OnTextChanged="Filter_TextChanged" runat="server" Text="" CssClass="search_input form-control" placeholder=""></asp:TextBox>
						</HeaderTemplate> 
                        <ItemTemplate> 
                            <asp:Label ID="lblFullName" runat="server" Text='<%# Bind("FullName") %>'></asp:Label> 
                        </ItemTemplate> 
                        <EditItemTemplate> 
                            <asp:Label ID="lblFullName" runat="server" Text='<%# Bind("FullName") %>'></asp:Label> 
                        </EditItemTemplate> 
                    </asp:TemplateField> 

                    <asp:TemplateField HeaderText="Date" SortExpression="TourDateDate"> 
                        <ItemTemplate> 
                            <asp:Label ID="lblTourDate" runat="server" Text=""></asp:Label> 
                            <asp:Image runat="server" ID="imgTourDate" />
                        </ItemTemplate> 
                        <EditItemTemplate>
                            <div class="input-group">
                                <asp:TextBox ID="txtTourDate" runat="server" Text="" placeholder="Date" CssClass="form-control"></asp:TextBox> 
                                <span class="input-group-btn">
                                    <button runat="server" class="btn btn-default" type="button" id="btnShowTourDate">
                                        <img src="<%=ResolveClientUrl("~") %>images/calander_icon.png" alt="calander" title="Calander" />
                                    </button>
                                </span>
                            </div> 
                        </EditItemTemplate> 
                    </asp:TemplateField> 

                    <asp:TemplateField HeaderText="Time"> 
                        <HeaderTemplate>
						    <asp:Label runat="server" ID="lblTourTimeHeader" data-field="TourTime" Text="Time"/>
                            <asp:TextBox ID="tbTourTimeHeader" EnableViewState="True" data-field="TourTime" OnTextChanged="Filter_TextChanged" runat="server" Text="" CssClass="search_input form-control" placeholder=""></asp:TextBox>
						</HeaderTemplate> 
                        <ItemTemplate> 
                            <asp:Label ID="lblTourTime" runat="server" Text='<%# Bind("TourTime") %>'></asp:Label> 
                        </ItemTemplate> 
                        <EditItemTemplate>
                            <asp:TextBox ID="txtTourTime" runat="server" Text='<%# Bind("TourTime") %>' placeholder="Time" CssClass="form-control"></asp:TextBox> 
                        </EditItemTemplate> 
                    </asp:TemplateField> 

                    <asp:TemplateField HeaderText="Company"> 
                        <HeaderTemplate>
						    <asp:Label runat="server" ID="lblTourCompanyNameHeader" data-field="TourCompanyName" Text="Company"/>
                            <asp:TextBox ID="tbTourCompanyNameHeader" EnableViewState="True" data-field="TourCompanyName" OnTextChanged="Filter_TextChanged" runat="server" Text="" CssClass="search_input form-control" placeholder=""></asp:TextBox>
						</HeaderTemplate> 
                        <ItemTemplate> 
                            <asp:Label ID="lblTourCompany" runat="server" Text='<%# Bind("TourCompanyName") %>'></asp:Label> 
                        </ItemTemplate> 
                        <EditItemTemplate> 
                            <asp:DropDownList ID="ddlTourCompany" runat="server" DataTextField="TourCompanyName" DataValueField="TourCompanyId" CssClass="form-control"/>
                        </EditItemTemplate> 
                    </asp:TemplateField> 

                    <asp:TemplateField HeaderText="Hotel"> 
                        <HeaderTemplate>
						    <asp:Label runat="server" ID="lblTourNameHeader" data-field="TourName" Text="Hotel"/>
                            <asp:TextBox ID="tbTourNameHeader" EnableViewState="True" data-field="TourName" OnTextChanged="Filter_TextChanged" runat="server" Text="" CssClass="search_input form-control" placeholder=""></asp:TextBox>
						</HeaderTemplate> 
                        <ItemTemplate> 
                            <asp:Label ID="lblTour" runat="server" Text='<%# Bind("TourName") %>'></asp:Label> 
                        </ItemTemplate> 
                        <EditItemTemplate> 
                            <asp:DropDownList ID="ddlTour" runat="server" DataTextField="TourName" DataValueField="TourId" CssClass="form-control"/>
                        </EditItemTemplate> 
                    </asp:TemplateField> 

                    <asp:TemplateField HeaderText="Hotel Cost" ItemStyle-HorizontalAlign="Right"> 
                        <ItemTemplate> 
                            <asp:Label ID="lblTourHotelCost" runat="server" Text=""></asp:Label> 
                        </ItemTemplate> 
                        <EditItemTemplate> 
                            <asp:TextBox ID="txtTourHotelCost" runat="server" Text="" placeholder="Hotel Cost" CssClass="form-control"></asp:TextBox> 
                        </EditItemTemplate> 
                    </asp:TemplateField> 

                    <asp:TemplateField HeaderText="Verified"> 
                        <HeaderTemplate>
						    <asp:Label runat="server" ID="lblVerifiedHeader" data-field="Verified" Text="Verified"/>
                            <asp:TextBox ID="tbVerifiedHeader" EnableViewState="True" data-field="Verified" OnTextChanged="Filter_TextChanged" runat="server" Text="" CssClass="search_input form-control" placeholder=""></asp:TextBox>
						</HeaderTemplate> 
                        <ItemTemplate> 
                            <asp:Label ID="lblVerified" runat="server" Text='<%# Bind("Verified") %>'></asp:Label> 
                        </ItemTemplate> 
                        <EditItemTemplate>
                            <asp:TextBox ID="txtVerified" runat="server" Text='<%# Bind("Verified") %>' placeholder="Verified" CssClass="form-control"></asp:TextBox> 
                        </EditItemTemplate> 
                    </asp:TemplateField> 

                    <asp:TemplateField HeaderText="Verification Sent"> 
                        <HeaderTemplate>
						    <asp:Label runat="server" ID="lblVerificationsSendHeader" data-field="VerificationsSend" Text="Verification Sent"/>
                            <asp:TextBox ID="tbVerificationsSendHeader" EnableViewState="True" data-field="VerificationsSend" OnTextChanged="Filter_TextChanged" runat="server" Text="" CssClass="search_input form-control" placeholder=""></asp:TextBox>
						</HeaderTemplate> 
                        <ItemTemplate> 
                            <asp:Label ID="lblVerificationsSend" runat="server" Text='<%# Bind("VerificationsSend") %>'></asp:Label> 
                        </ItemTemplate> 
                        <EditItemTemplate>
                            <asp:TextBox ID="txtVerificationsSend" runat="server" Text='<%# Bind("VerificationsSend") %>' placeholder="Verification Sent" CssClass="form-control"></asp:TextBox> 
                        </EditItemTemplate> 
                    </asp:TemplateField> 

                    <asp:TemplateField HeaderText="Notes">
                        <HeaderTemplate>
						    <asp:Label runat="server" ID="lblTourNotesHeader" data-field="TourNotes" Text="Notes"/>
                            <asp:TextBox ID="tbTourNotesHeader" EnableViewState="True" data-field="TourNotes" OnTextChanged="Filter_TextChanged" runat="server" Text="" CssClass="search_input form-control" placeholder=""></asp:TextBox>
						</HeaderTemplate> 
                        <ItemTemplate> 
                            <asp:Label ID="lblTourNotes" runat="server" Text='<%# Bind("TourNotes") %>'></asp:Label> 
                        </ItemTemplate> 
                        <EditItemTemplate>
                            <asp:TextBox ID="txtTourNotes" runat="server" Text='<%# Bind("TourNotes") %>' placeholder="Notes" CssClass="form-control"></asp:TextBox> 
                        </EditItemTemplate> 
                    </asp:TemplateField> 

                    <asp:TemplateField HeaderText="Confirmation Number"> 
                        <HeaderTemplate>
						    <asp:Label runat="server" ID="lblConfirmationNumberHeader" data-field="ConfirmationNumber" Text="Confirmation Number"/>
                            <asp:TextBox ID="tbConfirmationNumberHeader" EnableViewState="True" data-field="ConfirmationNumber" OnTextChanged="Filter_TextChanged" runat="server" Text="" CssClass="search_input form-control" placeholder=""></asp:TextBox>
						</HeaderTemplate> 
                        <ItemTemplate> 
                            <asp:Label ID="lblConfirmationNumber" runat="server" Text='<%# Bind("ConfirmationNumber") %>'></asp:Label> 
                        </ItemTemplate> 
                        <EditItemTemplate>
                            <asp:TextBox ID="txtConfirmationNumber" runat="server" Text='<%# Bind("ConfirmationNumber") %>' placeholder="Confirmation Number" CssClass="form-control"></asp:TextBox> 
                        </EditItemTemplate> 
                    </asp:TemplateField> 

                    <asp:TemplateField HeaderText="Upgrade Fee" ItemStyle-HorizontalAlign="Right"> 
                        <ItemTemplate> 
                            <asp:Label ID="lblUpgradeFee" runat="server" Text=""></asp:Label> 
                        </ItemTemplate> 
                        <EditItemTemplate> 
                            <asp:TextBox ID="txtUpgradeFee" runat="server" Text="" placeholder="Upgrade Fee" CssClass="form-control"></asp:TextBox> 
                        </EditItemTemplate> 
                    </asp:TemplateField> 

                    <asp:TemplateField HeaderText="Gift"> 
                        <HeaderTemplate>
						    <asp:Label runat="server" ID="lblGiftHeader" data-field="Gift" Text="Gift"/>
                            <asp:TextBox ID="tbGiftHeader" EnableViewState="True" data-field="Gift" OnTextChanged="Filter_TextChanged" runat="server" Text="" CssClass="search_input form-control" placeholder=""></asp:TextBox>
						</HeaderTemplate> 
                        <ItemTemplate> 
                            <asp:Label ID="lblGift" runat="server" Text='<%# Bind("Gift") %>'></asp:Label> 
                        </ItemTemplate> 
                        <EditItemTemplate>
                            <asp:TextBox ID="txtGift" runat="server" Text='<%# Bind("Gift") %>' placeholder="Gift" CssClass="form-control"></asp:TextBox> 
                        </EditItemTemplate> 
                    </asp:TemplateField> 

                    <asp:TemplateField HeaderText="Gift Cost" ItemStyle-HorizontalAlign="Right"> 
                        <ItemTemplate> 
                            <asp:Label ID="lblGiftCost" runat="server" Text=""></asp:Label> 
                        </ItemTemplate> 
                        <EditItemTemplate> 
                            <asp:TextBox ID="txtGiftCost" runat="server" Text="" placeholder="Gift Cost" CssClass="form-control"></asp:TextBox> 
                        </EditItemTemplate> 
                    </asp:TemplateField> 

                    <asp:TemplateField HeaderText="Comments"> 
                        <HeaderTemplate>
						    <asp:Label runat="server" ID="lblCommentsHeader" data-field="Comments" Text="Comments"/>
                            <asp:TextBox ID="tbCommentsHeader" EnableViewState="True" data-field="Comments" OnTextChanged="Filter_TextChanged" runat="server" Text="" CssClass="search_input form-control" placeholder=""></asp:TextBox>
						</HeaderTemplate> 
                        <ItemTemplate> 
                            <asp:Label ID="lblComments" runat="server" Text='<%# Bind("Comments") %>'></asp:Label> 
                        </ItemTemplate> 
                        <EditItemTemplate>
                            <asp:TextBox ID="txtComments" runat="server" Text='<%# Bind("Comments") %>' placeholder="Comments" CssClass="form-control"></asp:TextBox> 
                        </EditItemTemplate> 
                    </asp:TemplateField> 

                    
                </Columns>
                </asp:GridView>
                </div>
            </div>

            </ContentTemplate>
                <Triggers>
                    <asp:PostBackTrigger ControlID="btnExcelExport" />
                </Triggers>
            </asp:UpdatePanel>
</asp:Content>
